/*6Z/9eaUjZ0gHlRPudBRnSdc8VjumySDDsWmlX7CMIq0JHMFaUcb7vYIzuOWhvVr5*/
/*
 * @Author: xiahui 
 * @PageInfo: 卡片态返回 
 * @Date: 2019-01-14 14:59:21 
 * @Last Modified by: zhangmi
 * @Last Modified time: 2021-09-10 12:02:31
 */
import { AREA, URL, UISTATUS, PAGECODE } from '../../constance';
import { showWarningDialog } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';
import { showBackWarningDialog } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';
export default function(props) {
	let status = props.getUrlParam('status');
	let source = props.getUrlParam('source');
	let channelType = props.getUrlParam('channelType'); //推单标识
	//先判断是否是推单，推单标识有值走推单退出逻辑，其他代码不变
	if (channelType) {
		let allprocess = props.transferTable.getTransformFormStatus(AREA.cardLeftId);
		if (allprocess === false) {
			showBackWarningDialog({
				beSureBtnClick: () => {
					props.pushTo(URL.list, {
						appcode: props.getUrlParam('c'),
						pagecode: PAGECODE.listPagecode
					});
				}
			});
		} else {
			props.pushTo(URL.list, {
				appcode: props.getUrlParam('c'),
				pagecode: PAGECODE.listPagecode
			});
		}
	} else {
		if (status == UISTATUS.ref20 || status == UISTATUS.ref28) {
			let allprocess = props.transferTable.getTransformFormStatus(AREA.cardLeftId);
			let url = status == UISTATUS.ref20 ? URL.ref20 : URL.ref28;
			let pagecode = status == UISTATUS.ref20 ? PAGECODE.ref20Pagecode : PAGECODE.ref28Pagecode;
			if (allprocess === false) {
				showBackWarningDialog({
					beSureBtnClick: () => {
						props.pushTo(url, { pagecode: pagecode });
					}
				});
			} else {
				props.pushTo(url, { pagecode: pagecode });
			}
		} else if (source == URL.ref20 || source == URL.ref28) {
			let pagecode = source == URL.ref20 ? PAGECODE.ref20Pagecode : PAGECODE.ref28Pagecode;
			props.pushTo(source, { pagecode: pagecode });
		} else {
			props.pushTo(URL.list, { pagecode: PAGECODE.listPagecode });
		}
	}
}

/*6Z/9eaUjZ0gHlRPudBRnSdc8VjumySDDsWmlX7CMIq0JHMFaUcb7vYIzuOWhvVr5*/